package org.ishequ.smssendlistener;

import org.ishequ.uri.SMS;

import android.app.Service;
import android.content.ContentResolver;
import android.content.Intent;
import android.os.IBinder;

public class BootService extends Service {

	private SMSObserver smsObserver;
	private ContentResolver contentResolver;
	
	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}

	@Override
	public void onCreate() {
		contentResolver = this.getContentResolver();
		SMSHandler smsHandler = new SMSHandler(this.getApplicationContext());
		smsObserver = new SMSObserver(contentResolver, smsHandler);
		contentResolver.registerContentObserver(SMS.CONTNET_URI, true,
				smsObserver);
	}

	@Override
	public void onDestroy() {
		contentResolver.unregisterContentObserver(smsObserver);
	}

}
